home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / glimpse-2.1 / libtemplate / include / ccache_queue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-16  |  3.4 KB  |  80 lines

  1. /*
  2.  *  ccache_queue.h -
  3.  *
  4.  *  Mark Peterson  9/91    
  5.  * 
  6.  *  $Id: ccache_queue.h,v 1.6 1995/01/10 16:30:22 hardy Exp $
  7.  *
  8.  *  ----------------------------------------------------------------------
  9.  *  Copyright (c) 1994, 1995.  All rights reserved.
  10.  *  
  11.  *          Mic Bowman of Transarc Corporation.
  12.  *          Peter Danzig of the University of Southern California.
  13.  *          Darren R. Hardy of the University of Colorado at Boulder.
  14.  *          Udi Manber of the University of Arizona.
  15.  *          Michael F. Schwartz of the University of Colorado at Boulder. 
  16.  *  
  17.  *  This copyright notice applies to all code in Harvest other than
  18.  *  subsystems developed elsewhere, which contain other copyright notices
  19.  *  in their source text.
  20.  *  
  21.  *  The Harvest software was developed by the Internet Research Task
  22.  *  Force Research Group on Resource Discovery (IRTF-RD).  The Harvest
  23.  *  software may be used for academic, research, government, and internal
  24.  *  business purposes without charge.  If you wish to sell or distribute
  25.  *  the Harvest software to commercial clients or partners, you must
  26.  *  license the software.  See
  27.  *  http://harvest.cs.colorado.edu/harvest/copyright,licensing.html#licensing.
  28.  *  
  29.  *  The Harvest software is provided ``as is'', without express or
  30.  *  implied warranty, and with no support nor obligation to assist in its
  31.  *  use, correction, modification or enhancement.  We assume no liability
  32.  *  with respect to the infringement of copyrights, trade secrets, or any
  33.  *  patents, and are not responsible for consequential damages.  Proper
  34.  *  use of the Harvest software is entirely the responsibility of the user.
  35.  *  
  36.  *  For those who are using Harvest for non-commercial purposes, you may
  37.  *  make derivative works, subject to the following constraints:
  38.  *  
  39.  *  - You must include the above copyright notice and these accompanying 
  40.  *    paragraphs in all forms of derivative works, and any documentation 
  41.  *    and other materials related to such distribution and use acknowledge 
  42.  *    that the software was developed at the above institutions.
  43.  *  
  44.  *  - You must notify IRTF-RD regarding your distribution of the 
  45.  *    derivative work.
  46.  *  
  47.  *  - You must clearly notify users that your are distributing a modified 
  48.  *    version and not the original Harvest software.
  49.  *  
  50.  *  - Any derivative product is also subject to the restrictions of the 
  51.  *    copyright, including distribution and use limitations.
  52.  */
  53. #ifndef _CCACHE_QUEUE_H_
  54. #define _CCACHE_QUEUE_H_
  55.  
  56. #include "ccache_list.h"
  57.  
  58. typedef List_Node Queue_Node;    /*Define a Queue node same as a List node. */
  59. typedef Linked_List Queue;    /*Define a Queue header same as a List header.*/
  60.  
  61. /* **The queue toolkit contains: */
  62.  
  63. Queue *queue_create();        /*initialize queue header block */
  64. void queue_destroy();        /*destory queue header block */
  65. Boolean enqueue();        /*insert a new node at the end of the queue */
  66. Datum *dequeue();        /*delete a node from the head of the queue */
  67. Boolean queue_apply();        /*apply a function to each node in the queue */
  68. Boolean queue_empty();        /*is the queue empty? */
  69.  
  70. /*Special functions designed for use in a priority timer queue. */
  71. /*For use specifically with the time_it.h package. */
  72. Boolean tenqueue();        /*Enqueue's a timer value. */
  73. int tdequeue();            /*Dequeue's a timer value. */
  74. Datum *head();
  75.  
  76. #define queue_length(q_head) ((q_head)->count)
  77. /*Return the number of items in the queue. */
  78.  
  79. #endif
  80.